package com.example.act6.common.enums;


/**
 * @return {@link null}
 * @Author jrw
 * @Description 异常枚举
 * @Date 2022/3/7 16:20
 * @Param
 **/
public enum ExceptionEnum {
    BUSINESS_EXCEPTION(899999,"业务处理异常"),
    RUNTIME_EXCEPTION(800000,"未知运行时异常"),
    NULLPOINTER_EXCEPTION(800001,"空指针异常"),
    SQL_EXCEPTION(800002,"数据库操作异常"),
    DATAACCESS_EXCEPTION(800003,"其它数据库相关异常"),
    VALID_EXCEPTION(800004,"数据校验异常"),
    HTPP_MESSAGE_NOTREADABLE_EXCEPTION(800005,"消息体不可读"),
    DUPLICATEKEY_EXCEPTION(800006,"数据库已存在相同主键"),
    TYPEMISMATCH_DATAACCESS_EXCEPTION(800007,"Java类型和数据类型不匹配"),
    DEADLOCKLOSER_DATAACCESS_EXCEPTION(800008,"数据库死锁"),
    RESOURCE_FAILURE_DATAACCESS_EXCEPTION(800009,"数据库连接失败"),
    NUMBERFORMAT_EXCEPTION(800010,"字符串转换成数字类型失败"),
    HTTP_MEDIA_TYPE_NOT_SUPPORTED_EXCEPTION(800011,"数据传输格式异常"),
    SIZE_LIMIT_EXCEEDED_EXCEPTION(800012,"导入数据超过最大限制100M"),
    METHOD_ARGUMENT_TYPE_MISMATCH_EXCEPTION(800013,"参数格式不匹配"),
    MISSING_SERVLET_REQUESR_PARAMETER_EXCEPTION(800014,"缺少必填参数"),
    CONSTRAINT_VIOLATION_EXCEPTION(800015,"字段校验"),
    PARAM_EXCEPTION(800016,"请检查参数是否合理"),
    EXCEPTION(810000,"系统未定义异常");
    private Integer code;
    private String message;

    ExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getMessage() {
        return  this.message;
    }

    public Integer getCode() {
        return this.code;
    }
}
